local L = {
	["Tainted Core"] = "Tainted Core"
}
if GetLocale() == "deDE" then
	L["Tainted Core"] = "Besudelter Kern"
end

local frame = CreateFrame("Frame")

function frame:OnEvent(event, ...)
	if event == "BAG_UPDATE" and InCombatLockdown() and UnitInRaid("player") then -- only scan in raids and in combat
		self:ScanBags()
	end
end

function frame:ScanBags()
	for bag=0, 4 do
		for slot=1, GetContainerNumSlots(bag) do
			if GetContainerItemLink(bag, slot):find(L["Tainted Core"]) then
				self:Alarm()
				do return end
			end
		end
	end
end

function frame:Alarm()
	UIErrorsFrame:AddMessage("DU HAST DEN KERN!")
	PlaySound("ReadyCheck")
	UIFrameFlash(LowHealthFrame, 0.2, 0.2, 2, false, 0.2, 0.2)
end

frame:SetScript("OnEvent", frame.OnEvent)
frame:RegisterEvent("BAG_UPDATE")
